package com.gitee.wsl.compose.mvi.ui.radiobutton

import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.material3.RadioButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.gitee.wsl.compose.mvi.component.InteractionSourceProjector


class RadioButtonProjector(
    interactor: RadioButtonInteractor,
    presenter: RadioButtonPresenter = RadioButtonPresenter.Default
) : InteractionSourceProjector<RadioButtonInteractor, RadioButtonPresenter>(interactor, presenter) {


    @Composable
    override fun body(
        combinedModifier: Modifier,
        interactor: RadioButtonInteractor,
        presenter: RadioButtonPresenter,
        interactionSource: MutableInteractionSource,
    ) {
        RadioButton(
            selected = interactor.selected,
            onClick = interactor.onClick,
            modifier = combinedModifier,
            enabled = interactor.enabled,
            interactionSource = interactionSource,
            colors = presenter.colors
        )
    }
}